<!-- html -->
<template>
  <span class="span2">父组件内容：{{ parentText }}</span>
  <button class="button1" @click="changeParentText">修改内容</button>
  <button class="button1" @click="parentChangeText">父组件修改内容</button>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
  name: 'propsTest1Children1'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
//数据
//接收参数
let { parentText, parentChangeText } = defineProps(['parentText', 'parentChangeText'])
//方法
function changeParentText() {
  parentText += '-'
  console.log("parentText：", parentText)
}
</script>

<!-- 样式 -->
<style scoped></style>